package sl.sl21;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sl.sl2.dao.UserDao;
import sl.sl2.pojo.User;
import sl.sl2.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

    /**
     * 保存用户信息
     *
     * @param user
     */
    @Override
    public void save(User user) {
        //这里并为实现完整的数据库操作，仅为说明问题
        //System.out.println("保存用户信息到数据库");
        dao.save(user);
    }

    @Autowired
    private UserDao dao;
    public void setDao(UserDao dao) {
        this.dao = dao;
    }

}
